<?php

namespace app\common\model;

use think\Model;

/**  TX
 *   推广升级日志 模型
 *   Date: 2020/11/24
 * Class OaWorkersUpgradeLog
 * @package app\common\model
 */
class OaWorkersUpgradeLog extends Model {

    // 表名
    protected $name = 'oa_workers_upgrade_log';

    // 列表查询
    public function getAll($where, $join = [], $page = 1, $pageSize = -1, $field = '*', $order = 'c.workers_id desc') {
        if ($pageSize > 0) {
            $result = $this->alias('c')->where($where)
                ->join($join)
                ->field($field)
                ->page($page, $pageSize)
                ->order($order)
                ->select();
        } else {
            $result = $this->alias('c')->where($where)
                ->join($join)
                ->field($field)
                ->order($order)
                ->select();
        }
        return $result;
    }
    //新增
    public function add($data = []) {
        $result = $this->insertGetId($data);
        return $result;
    }


}
